<template>
  <div>
    <el-dialog :visible.sync="dialog.detail" title="详情" width="80%" append-to-body>
      <div class="detail-info">
        <el-row>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
            <span class="detail-title">字典编码：</span>
            <span v-text="form.dictCode" />
          </el-col>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
            <span class="detail-title">字典名称：</span>
            <span v-text="form.dictName" />
          </el-col>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
            <span class="detail-title">描述：</span>
            <span v-text="form.description" />
          </el-col>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
            <span class="detail-title">版本号：</span>
            <span v-text="form.version" />
          </el-col>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
            <span class="detail-title">创建时间：</span>
            <span v-text="form.createTime" />
          </el-col>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
            <span class="detail-title">更新时间：</span>
            <span v-text="form.updateTime" />
          </el-col>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
            <span class="detail-title">是否可用：</span>
            <span v-text="form.isActive" />
          </el-col>
        </el-row>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="dialog.detail = false">关闭</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import * as utils from '@/utils/utils'
import * as ResponseStatus from '@/utils/response-status'
const resUrl = process.env.VUE_APP_RES_URL
export default {
  name: 'DataDictDetail',
  data() {
    return {
      dialog: {
        detail: false
      },
      form: {
        id: undefined,
        dictCode: undefined,
        dictName: undefined,
        description: undefined,
        version: undefined,
        createTime: undefined,
        updateTime: undefined,
        isActive: undefined
      },
      dataDictCodes: ['YES_NO'],
      resUrl: resUrl
    }
  },
  computed: {},
  mounted() {},
  methods: {
    getDictItemsDisplayValue() {
      utils
        .getDataDict(this.dataDictCodes)
        .then(response => {
          if (response) {
            if (response) {
              utils.getDetailDictItemDisplayValue({
                mainComponent: this,
                dataDictItems: response,
                dictCode: 'YES_NO',
                formProp: 'isActive'
              })
            }
          }
        })
        .catch(error => {
          console.log(error)
        })
    }
  }
}
</script>

<style>
</style>
